package com.example.kliven.because.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.example.kliven.because.fragment.HealthFragment;
import com.example.kliven.because.fragment.MessageFragment;
import com.example.kliven.because.fragment.InterestingFragment;
import com.example.kliven.because.fragment.FashionFragment;

/**
 * Created by Kliven on 16/1/11.
 */
public class MessagePagerAdapter extends FragmentPagerAdapter {
    public final static int TAB_COUNT = 3;
    public MessagePagerAdapter(FragmentManager fm) {
        super(fm);
    }

    @Override
    public Fragment getItem(int position) {
        switch (position) {
            case MessageFragment.TAB_COMMEND:
                HealthFragment healthFragment = new HealthFragment();
                return healthFragment;
            case MessageFragment.TAB_NOTIFY:
                InterestingFragment notifyFragment = new InterestingFragment();
                return notifyFragment;
            case MessageFragment.TAB_PRIVATE_MSG:
                FashionFragment privateMsgFragment = new FashionFragment();
                return privateMsgFragment;

        }
        return null;
    }

    @Override
    public int getCount() {
        return TAB_COUNT;
    }
}
